from selenium.webdriver.common.by import By

from base import Base
#定位元素
class Page(Base):
    #点击关注
    def guanzhu(self):
        #使用android uiautomator定位
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("关注")')
        ele=self.find_ele(loc)
        return ele
    #点击评论按钮
    def pinglun(self):
        #使用ID定位
        loc=(By.ID,'com.xiachufang:id/common_control_panel_comment_btn_drawable')
        ele=self.find_ele(loc)
        return ele
    #评论框
    def kuang(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.xiachufang:id/bottom_input_area"]')
        ele=self.find_ele(loc)
        return ele
    #点击发送按钮
    def fasong(self):
        #使用XPATH定位
        loc=(By.XPATH,'//android.widget.ImageView[@resource-id="com.xiachufang:id/common_control_panel_comment_btn_drawable"]')
        ele=self.find_ele(loc)
        return ele
    #点击返回按钮
    def fanhui(self):
        #使用ACCESSIBILITY_ID定位
        loc=(By.ACCESSIBILITY_ID,'返回')
        ele=self.find_ele(loc)
        return ele
